import React, { FC } from "react"
import { useNavigate } from "react-router-dom"
import { Button, Typography } from "antd"
import { MANGE_INDEX_PATHNAME } from "../router"
const { Title, Paragraph } = Typography
import styles from "./home.module.scss"
// import axios from "axios"

const Home: FC = () => {
    const nav = useNavigate()

    // function clickHandler() {
    //     // nav("/login")
    //     // 带参数：
    //     nav({
    //         pathname: "/login",
    //         search: "b=21"
    //     })
    // }

    // useEffect(() => {
    //     axios.get("/api/test").then(res => {
    //         // console.log(res.data)
    //     })
    // }, [])

    return (
        <div className={styles.container}>
            <div className={styles.info}>
                <Title>问卷调查 | 在线投票</Title>
                <Paragraph>已累计创建问卷 100 份，发布问卷 90 份，收到答卷 980 份</Paragraph>
                <div>
                    <Button type="primary" onClick={() => nav(MANGE_INDEX_PATHNAME)}>
                        开始使用
                    </Button>
                </div>
            </div>
        </div>
    )
}

export default Home
